package com.fxsh168.server.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

public class OrderAdapter extends FragmentStatePagerAdapter {
    private List<Fragment>orderFragmentLists;
    private String[] tabs;

    public OrderAdapter(FragmentManager fm, List<Fragment> orderFragmentLists, String[] tabs) {
        super(fm);
        this.orderFragmentLists = orderFragmentLists;
        this.tabs = tabs;
    }

    public OrderAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return orderFragmentLists.get(position);
    }

    @Override
    public int getCount() {
        return orderFragmentLists.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabs[position];
    }
}
